<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //封装了一个函数
        function $(selector) {
            return document.querySelector(selector)
        }

        function $$(selector) {
            return document.querySelectorAll(selector)

        }
    </script>
</body>

</html>